<?php
/**
 * Klasse für das jeweilige Fahrzeug und die Fahrzeuginfos des Fahrers.
 *
 * @author Timo
 */
class Vehicle {
    private $name                    = 'Default vehicle';
    private $class                   = 'Default class'; // Für versch. Klassen innerhalb einer Serie z.B. eGP1, eGP2
    private $default_extra_weight_kg = 0; // Fahrzeuggewicht, welches zum ausbalancieren der Fahrzeugstärken genutzt wird (z.B. eTC)
    private $engine                  = 'Default motor';
    private $engine_horsePowers      = 0;
    private $rpm                     = 0;

    public function SetName($name)
    {
        if(is_string($name))
        {
            $this->name = $name;
        }
        else
        {
            echo $name . ' is not a string.';
        }
    }

    public function SetClass($class)
    {
        if(is_string($class))
        {
            $this->class = $class;
        }
        else
        {
            echo $class . ' is not a string.';
        }
    }

    public function SetEngine($engine)
    {
        if(is_string($engine))
        {
            $this->engine = $engine;
        }
        else
        {
            echo $engine . ' is not a string.';
        }
    }

    public function SetEnginePower($horse_powers)
    {
        if(is_integer($horse_powers))
        {
            $this->engine_horsePowers = $horse_powers;
        }
        else
        {
            echo $horse_powers . ' is not an integer.';
        }
    }

        public function SetRPM($rpm)
    {
        if(is_integer($rpm))
        {
            $this->rpm = $rpm;
        }
        else
        {
            echo $rpm . ' is not an integer.';
        }
    }

    public function SetDefaultExtraWeight($kg)
    {
        if(is_numeric($kg))
        {
            $this->default_extra_weight_kg = $kg;
        }
        else
        {
            echo $kg . ' is not a number.';
        }
    }

    public function GetName()
    {
        return $this->name;
    }

    public function GetClass()
    {
        return $this->class;
    }

    public function GetEngine()
    {
        return $this->engine;
    }

    public function GetEnginePower()
    {
        return $this->engine_horsePowers;
    }

    public function GetRPM()
    {
        return $this->rpm;
    }

    public function GetDefaultExtraWeight()
    {
        return $this->default_extra_weight_kg;
    }
}
?>